// 表单提交验证
// 通过验证返回true
// 反之返回 false

import type { ElForm } from 'element-plus'

export const submitForm = (formEl: InstanceType<typeof ElForm> | undefined) => {
    if(!formEl) return
    formEl.validate((valid) => {
        if(valid){
            console.log('submit!')
        }else{
            console.log('error submit!')
            return false
        }
    })
}

export const resetForm = (formEl: InstanceType<typeof ElForm> | undefined) => {
    if(!formEl) return
    formEl.resetFields()
}